package cn.hnucm.searchesservice.config;


import org.apache.http.HttpHost;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestHighLevelClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Description:
 * @author: chenjintao
 * @Date: 2021/12/20 19:58
 */
@Configuration
public class ElasticSearchClientConfig {

    @Bean
    public RestHighLevelClient getRestHighLevelClient(){
        RestHighLevelClient client = new RestHighLevelClient(RestClient.builder(
                new HttpHost("127.0.0.1", 9200, "http"),
                new HttpHost("127.0.0.1", 9201, "http")
        ));
        return  client;
    }
}
